const lineDash = [4, 2, 1, 2];
export default G6 => {
  G6.registerEdge('line-lr', {
    draw: function draw(cfg, group) {
      const startPoint = cfg.startPoint;
      const endPoint = cfg.endPoint;
      const {stroke, radius, lineWidth, startArrow, endArrow} = cfg.style;
  
      const keyShape = group.addShape('path', {
        attrs: {
          path: [
            ['M', startPoint.x+20, startPoint.y],
            ['L', endPoint.x / 2.5 + (2 / 3) * startPoint.x, startPoint.y],
            ['L', endPoint.x / 2.5 + (2 / 3) * startPoint.x, endPoint.y],
            ['L', endPoint.x-20, endPoint.y],
          ],
          stroke,
          radius,
          lineWidth,
          startArrow,
          endArrow,
        },
        className: 'edge-shape',
        name: 'edge-shape',
      });
      return keyShape;
    },
  });
  G6.registerEdge('line-tb', {
    draw(cfg, group) {
      const startPoint = cfg.startPoint;
      const endPoint = cfg.endPoint;
      const {stroke, radius, lineWidth, startArrow, endArrow} = cfg.style;

      const shape = group.addShape('path', {
        attrs: {
          path: [
            ['M', startPoint.x, startPoint.y+20],
            ['L', startPoint.x, (startPoint.y + endPoint.y) / 2],
            ['L', endPoint.x, (startPoint.y + endPoint.y) / 2],
            ['L', endPoint.x, endPoint.y-20],
          ],
          stroke,
          radius,
          lineWidth,
          startArrow,
          endArrow,
        },
      });
  
      return shape;
    },
  });
};